# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=narthex
pkgver=v1.2.r7.g8b78746
pkgrel=1
groups=('blackarch' 'blackarch-misc')
pkgdesc='Modular personalized dictionary generator.'
url='https://github.com/MichaelDim02/Narthex'
arch=('x86_64' 'aarch64')
license=('GPL3')
depends=('glibc')
makedepends=('git')
source=("$pkgname::git+https://github.com/MichaelDim02/Narthex.git"
        'Makefile.patch')
sha512sums=('SKIP'
            '566ecb70f8aeb92aa594e09991872b39379857f8e698e672fce7f0054fc7aa674fee398a8e9c19707d697d3767b7e1627b343dffdd12bee69fba488af27d6a52')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd $pkgname

  patch -p0 < ../Makefile.patch
}

build() {
  cd $pkgname

  make
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/var/lib/$pkgname"

  install -Dm 755 -t "$pkgdir/usr/bin/" nhance ninc nleet ncom nclean napp

  install -m 755 rev/nrev.sh "$pkgdir/usr/bin/nrev"
  install -m 755 wiz/nwiz.sh "$pkgdir/usr/bin/nwiz"

  install -m 644 wiz/elder.txt "$pkgdir/var/lib/$pkgname/elder.txt"

  install -Dm 644 -t "$pkgdir/usr/share/man/man1/" enhance/nhance.1 inc/ninc.1 \
    leet/nleet.1 com/ncom.1 clean/nclean.1 app/napp.1 rev/nrev.1
}

